package com.xiaochong.tir.api.util;

import com.xiaochong.tir.common.util.ApiResultCodeUtils;
import com.xiaochong.tir.common.util.RedisKeysUtils;

/**
 * Created by org on 2018/7/6.
 * 选币接口对应redis的key
 */
public enum SelectCoinTypeEnum {

    LOOK_UP_30_HIGH(RedisKeysUtils.K_ACTION_LOOK_UP_30_HIGH_PRICE,1),//看涨-选币30天创新高数据
    LOOK_UP_UP_UP(RedisKeysUtils.K_ACTION_LOOK_UP_UP_UP_PRICE,2),//看涨-选币连续上涨突破
    LOOK_UP_AVERAGE_BREACH(RedisKeysUtils.K_ACTION_LOOK_UP_AVERAGE_BREACH_PRICE,3),//看涨-选币均线上涨
    LOOK_UP_BREACH_BOTTOM(RedisKeysUtils.K_ACTION_LOOK_UP_BREACH_BOTTOM_PRICE,4),//看涨-选币上涨突破箱体
    LOOK_DROP_30_LOW(RedisKeysUtils.K_ACTION_LOOK_DROP_30_LOW_PRICE_DATA,5),//看跌-选币30天创新低数据
    LOOK_DROP_30_CONTINUITY(RedisKeysUtils.K_ACTION_LOOK_DROP_CONTINUITY,6),//看跌-连续下跌破位
    LOOK_DROP_BREACH_BOTTOM(RedisKeysUtils.K_ACTION_LOOK_DROP_BREACH_BOTTOM_PRICE,7),//看跌-选币跌破箱体
    LOOK_DROP_AVERAGE_BREACH(RedisKeysUtils.K_ACTION_LOOK_DROP_AVERAGE_BREACH_PRICE,8);//看跌-选币均线下跌

    public static String getNameByIndex(Integer index) {
        for (SelectCoinTypeEnum managerConstans : SelectCoinTypeEnum.values()) {
            if (managerConstans.getIndex().equals(index)) {
                return managerConstans.getName();
            }
        }
        return "";
    }
    private String name;

    private Integer index;

    SelectCoinTypeEnum(String name, Integer index) {
        this.name=name;
        this.index=index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }
}
